package com.jt.mapper;

import com.jt.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface UserMapper {
    @Select("select * from user where username=#{username} and password=#{password}")
    User findUserByUP(User user);


@Select("select count(*) from user")
    long findTotal();
    List<User> finduserlistbypage(@Param("start") int start,
                                  @Param("size") int size,
                                  @Param("query") String query);

    @Update("update user set status = #{status} where id = #{id}")
    void update(User user);


    void saveUser(User user);

    @Select("select * from user where id = #{id}")
    User findId(Integer id);


    @Update("update user set phone=#{phone} , email = #{email} where id = #{id}")
    void updateUser(User user);

@Delete("delete from user where id = #{id}")
    void findDelete(Integer id);

    @Select("select * from user where id = #{userid}")
    void findIds(Integer userId);
}
